home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9333 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: detroit.freenet.org!ab411
  2. From: ab411@detroit.freenet.org (David R. Conrad)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Tradition or what?
  5. Date: 9 Mar 1996 14:24:27 GMT
  6. Organization: Greater Detroit Free-Net, Detroit, MI
  7. Message-ID: <4hs4ar$q1m@detroit.freenet.org>
  8. References: <825289080snz@genesis.demon.co.uk> <4g0elg$mdr@redstone.interpath.net> <Dn4wML.5LJ@undergrad.math.uwaterloo.ca> <82495
  9. Reply-To: ab411@detroit.freenet.org (David R. Conrad)
  10. NNTP-Posting-Host: detroit.freenet.org
  11.  
  12.  
  13. In a previous article, fred@genesis.demon.co.uk (Lawrence Kirby) says:
  14.  
  15. >In article <4gqdop$jfo@redstone.interpath.net>
  16. >           softbase@mercury.interpath.net
  17. >           "Scott McMahan - Softbase Systems" writes:
  18. >
  19. >>Speaking of bizarre return values, do people realize 0 is used to mean
  20. >>both success, failure, and a valid return value in the standard
  21. >>library!? All three in the same library!
  22. >
  23. >I don't find that to be a great problem. The semantics of each function
  24. >usually suggest quite naturally what 0 should mean.
  25.  
  26. With apologies to the original author; I only saved the text, not
  27. the attribution.
  28.  
  29.                               -=-=-
  30.  
  31. Zero is an enigmatic value.
  32.  
  33. It can mean success (fclose) or failure (scanf).
  34.  
  35. It can mean black or white.
  36.  
  37. It can mean no permissions (chmod) or all permissions (umask).
  38.  
  39. It can mean now (setjmp) or later (atexit).
  40.  
  41. It can mean the beginning (lseek) or the end (read).
  42.  
  43. It can mean myself (getpgrp) or child (fork).
  44.  
  45. It can mean all (kill's 1st argument) or nothing (kill's 2d argument).
  46.  
  47. It can mean `default' (SIG_IGN) or `I don't care' (waitpid)
  48.    or `try to guess' (strtol).
  49.  
  50. Indeed 0 lets you talk to God (setuid).
  51.  
  52. Verily is 0 all things to all people.
  53.  
  54.                               -=-=-
  55.  
  56. -- 
  57. David R. Conrad, conrad@detroit.freenet.org   PGP key on    GDFN Hardware and
  58. http://detroit.freenet.org/staff/conrad        home page   Software Committee
  59. "If you can't say 'fuck', you can't say 'fuck the government'." --Lenny Bruce
  60. "We had to destroy the Global Electronic Village in order to save it." --Exon
  61.